﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web;
using System.Web.Http;
using web_api.Models;

namespace web_api.Controllers
{
    public class RegisterController : ApiController
    {
        //注册
        public int Post() 
        {
            var username = HttpContext.Current.Request["username"];
            var password = HttpContext.Current.Request["password"];
            var secret = HttpContext.Current.Request["secret"];
            var answer = HttpContext.Current.Request["answer"];
            bool selu=DBhelper.Upuser(username, password, secret, answer);
            if (selu==true)
            {
                return 1;
            }
            else
            {
                return 2;
            }
            
        }
    }
}
